<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<p:dataTable id="supplierListTable" var="supplier" value="#{supplierModel.list}" filteredValue="#{supplierModel.filteredList}" filterEvent="enter"
		 rowKey="#{supplier.id}" selection="#{supplierModel.current}"
		selectionMode="single" paginator="true"   rows="10" rowsPerPageTemplate="5,7,10,15,20,30,40,50"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
		<p:ajax event="rowSelect" update=":detailForm,:headerForm"
			listener="#{supplierController.onRowSelect}"></p:ajax>
		<p:column headerText="id" sortBy="#{supplier.id}" filterBy="#{supplier.id}"
			filterMatchMode="contains" style="max-width:25px">			
			<h:outputText value="#{supplier.id}" />
		</p:column>
		<p:column headerText="number" sortBy="#{supplier.number}" filterBy="#{supplier.number}"
			filterMatchMode="contains" style="max-width:55px">
			<h:outputText value="#{supplier.number}" />
		</p:column>
		<p:column headerText="name" sortBy="#{supplier.name}" filterBy="#{supplier.name}"
			filterMatchMode="contains">
			<h:outputText value="#{supplier.name}" />
		</p:column>	
		<p:column headerText="name" sortBy="#{supplier.name}" filterBy="#{supplier.name}"
			filterMatchMode="contains">
			<h:outputText value="#{supplier.balance}" />
		</p:column>			
		<p:column headerText="address" sortBy="#{supplier.address}" filterBy="#{supplier.address}"
			filterMatchMode="contains">			
			<h:outputText value="#{supplier.address}" />
		</p:column>

		<p:column headerText="contact person" sortBy="#{supplier.contactPerson}" filterBy="#{supplier.contactPerson}"
			filterMatchMode="contains">
			<h:outputText value="#{supplier.contactPerson}" />
		</p:column>
		<p:column headerText="Telephone" sortBy="#{supplier.telephone}" filterBy="#{supplier.telephone}"
			filterMatchMode="contains">
			<h:outputText value="#{supplier.telephone}" />
		</p:column>
	</p:dataTable>
</ui:composition>
</html>